package com.eascs.o2o.recruit.controller;

import java.util.List;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.eascs.common.card.IDCard;
import com.eascs.site.view.BaseRestResult;
import com.eascs.workflow.common.entity.sys.ActOrgEntity;
import com.eascs.workflow.common.service.sys.SysOrgService;

@RestController
@RequestMapping("/rest")
public class ApplyForInfoRestController {
	@Reference
	private SysOrgService sysOrgService;
	
	@RequestMapping("/selCooperation")
	public BaseRestResult<String> selCooperation(String province) {
		List<ActOrgEntity> cooperations = sysOrgService.getChildOrgByName(province);
		String json=JSON.toJSONString(cooperations);
		return BaseRestResult.buildRestResult(json);
	}
	
	@RequestMapping("/verifyIdCard")
	public BaseRestResult<String> isIdCard(String idCard) {
		boolean isIdCard = new IDCard().verify(idCard);
		if (isIdCard) {
			return BaseRestResult.buildRestResult("true");
		} else {
			return BaseRestResult.buildRestResult("false");
		}
	}
	
}








